package com.haiziwang.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ReadActivity extends Activity {
	Button btn1,btn2,btn3,btn4,btn5,btn6;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.read);
		btn1 = (Button)findViewById(R.id.button1);
		btn2 = (Button)findViewById(R.id.button2);
		btn3 = (Button)findViewById(R.id.button3);
		btn4 = (Button)findViewById(R.id.button4);
		btn5 = (Button)findViewById(R.id.button5);
		btn6 = (Button)findViewById(R.id.button6);

		
		btn1.setOnClickListener(new MyListener() );
		btn2.setOnClickListener(new MyListener() );
		btn3.setOnClickListener(new MyListener() );
		btn4.setOnClickListener(new MyListener() );
		btn5.setOnClickListener(new MyListener() );
		btn6.setOnClickListener(new MyListener() );
		
	}
	class MyListener implements Button.OnClickListener
	{

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			String url = null;
			if((Button)v==btn1)
				url="file:///android_asset/2007.html";
			else if((Button)v==btn2)
				url="file:///android_asset/2008.html";
			else if((Button)v==btn3)
				url="file:///android_asset/2009.html";
			else if((Button)v==btn4)
				url="file:///android_asset/2010.html";
			else if((Button)v==btn5)
				url="file:///android_asset/2011.html";
			else if((Button)v==btn6)
				url="file:///android_asset/2012.html";
			Intent intent = new Intent();
			intent.putExtra("URL", url);
			intent.setClass(ReadActivity.this, CommonWebView.class);
			startActivity(intent);
			
		}
		
	}
}
